package com.cloudbroker.openapi.manage.controller;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cloudbroker.bcs.common.entity.HSBCPSBackVO;
import com.cloudbroker.bcs.common.util.VOUtil;
import com.cloudbroker.bcs.platform.dav.bizapi.service.business.plugs.result.PlugsTypeListResult;
import com.cloudbroker.bcs.platform.dav.bizapi.service.business.plugs.vo.PlugsTypeForm;
import com.cloudbroker.bcs.platform.dav.bizapi.service.business.plugs.vo.PlugsTypeListForm;
import com.cloudbroker.bcs.platform.dav.bizapi.t2service.business.PlugsTypeT2BizService;
import com.cloudbroker.bcs.platform.dav.common.ext.annotation.SaveLog;

import static com.cloudbroker.bcs.platform.dav.common.util.RequestUtil.getSingleParameterMapForBody;

@Controller
public class PlugsTypeController {

	@Resource
	private PlugsTypeT2BizService plugsTypeT2;
	
	@ResponseBody
	@RequestMapping("func_plugstype_save")
	@SaveLog(remark = "组件分类添加")
	public HSBCPSBackVO funcPlugsTypeSave(HttpServletRequest request,String jsonpcallback){
		PlugsTypeForm form = getSingleParameterMapForBody(request,PlugsTypeForm.class);
		return VOUtil.setJsonpResult(plugsTypeT2.funcPlugsTypeSave(form), jsonpcallback);
	}
	
	@ResponseBody
	@RequestMapping("func_plugstype_update")
	@SaveLog(remark = "组件分类修改")
	public HSBCPSBackVO funcPlugsTypeUpdate(HttpServletRequest request,String jsonpcallback){
		PlugsTypeForm form = getSingleParameterMapForBody(request,PlugsTypeForm.class);
		return VOUtil.setJsonpResult(plugsTypeT2.funcPlugsTypeUpdate(form), jsonpcallback);
	}
	
	@ResponseBody
	@RequestMapping("func_plugstype_list")
	@SaveLog(remark = "组件分类列表")
	public PlugsTypeListResult funcPlugsTypeList(HttpServletRequest request,String jsonpcallback){
		PlugsTypeListForm form = getSingleParameterMapForBody(request,PlugsTypeListForm.class);
		return VOUtil.setJsonpResult(plugsTypeT2.funcPlugsTypeList(form), jsonpcallback);
	}
}
